package com.wkbb.basic.mapper;

import com.wkbb.basic.model.Student;
import com.wkbb.common.dto.basic.StudentFaceRecognition;
import com.wkbb.basic.vo.StudentManageEditVo;
import com.wkbb.common.base.BaseMapper;
import com.wkbb.basic.vo.StudentEditInfoVo;
import com.wkbb.common.dto.basic.McStudentInfoDto;
import com.wkbb.common.dto.basic.StudentInfoDto;
import com.wkbb.common.dto.basic.UserInfoDto;
import com.wkbb.common.dto.im.StudentFamilyDto;
import com.wkbb.common.dto.order.PayUserCommodityInfoDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface StudentMapper extends BaseMapper<Student> {

    int insertStudentFaceRecognition(StudentFaceRecognition studentFaceRecognition);

    StudentEditInfoVo getStudentInfoById(Long id);

    StudentManageEditVo getStudentInfoWithFamilyList(Map<String, Object> params);

    List<StudentInfoDto> getStudentInfoPageList(Map<String, Object> params);

    StudentInfoDto getStudentInfoByMapParams(Map<String, Object> params);

    List<StudentInfoDto> getStudentInfoByStudent(Map<String, Object> params);

    List<StudentInfoDto> getStudentInfoByFamily(Map<String, Object> params);

    List<StudentInfoDto> getStudentInfoList(Map<String, Object> params);

    List<StudentFamilyDto> getStudentFamilyDto(Map<String, Object> params);

    Student getByUserId(@Param("userId") Long userId);

    List<UserInfoDto> getGuardianInfoList(Map<String, Object> params);

    void updateBack(Student student);

    /**
     * 根据学号或userId或studentId查找学生信息
     *
     * @param params 学号或userId或studentId
     * @return 学生信息
     */
    List<StudentInfoDto> getStudentByNo(Map<String, Object> params);

    //TODO 后面要把学生删除改成这个（未测）
    void deleteStudent(Map<String, Object> params);

    StudentInfoDto getStudentInfoByMobile(Map<String, Object> params);

    McStudentInfoDto getByCardNo(Map<String, Object> params);

    Student getUniqueByMapParams(Map<String, Object> studentParams);

    List<Map<String, Object>> getStudentStatByGrade(Long orgId);

    List<Map<String, Object>> getStudentStatBySex(Long orgId);

    Integer getCountByOrgId(Long orgId);

    Integer getCountByCardNo(Map<String, Object> studentParams);

    Integer getStudentCount(Map<String, Object> params);

    List<Long> getStudentUserIdByParam(Map<String, Object> params);

    List<PayUserCommodityInfoDto> getUserPackageByParam(Map<String, Object> params);

    List<StudentInfoDto> getStudentFamilyList(Map<String, Object> params);

    List<UserInfoDto> getChangeUserIdList(Map<String, Object> params);
    
    
    void studentGraduate(Map<String, Object> params);
    
    void  upGradeClass(Map<String, Object> params);

    void updateGrade(Map<String, Object> paramMap);

    Student findStudent(Map<String, Object> params);

    Student findByMapParams(Map<String, Object> map);

    int insertClassStudent(Student student);
    int insertClassStudentBatch(@Param("list")List<Student> list);
    int deleteClassStudent(Student student);
    Integer getClassMaxStudentNo(@Param("classId") Long classId);
    int deleteClassStudents(@Param("studentIds")String studentIds, @Param("classId")Long classId);
    List<Student> findClassStudents(Long classId);
    void updateClassStudent(Student student);

    List<StudentInfoDto> getStudentPageList(Map<String, Object> params);

    List<Student> findListByMapParams(Map<String, Object> map);

    void delClassStudent(@Param("studentId")Long studentId);
}